package com.wyh.wyhblog.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wyh.wyhblog.dao.TArticleDao;
import com.wyh.wyhblog.model.TArticle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wuyuhan
 * @date 2020/12/7 21:22
 */
@Service
public class TAeticleServiceImpl implements TAeticleService{

    @Autowired
    TArticleDao tArticleDao;

    @Override
    public PageInfo<TArticle> selectAll(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<TArticle> tArticles = tArticleDao.selectAll();
        return new PageInfo<>(tArticles);
    }
}
